package Controller;

import Model.ArrangeError;
import Model.DeadError;
import Model.DealAndSignIn;
import Model.HospError;
import Service.ArrangeErrorService;
import Service.DeadErrorService;
import Service.DealAndSignInService;
import Service.HospErrorService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/toDataAnalysis")
public class DataAnalysisController {
    @Autowired
    DealAndSignInService dealAndSignInService;
    @Autowired
    ArrangeErrorService arrangeErrorService;
    @Autowired
    DeadErrorService deadErrorService;
    @Autowired
    HospErrorService hospErrorService;

    //检测交易与签到异常数据
    @RequestMapping("/dealAndSign")
    @ResponseBody
    public PageInfo dealAndSignError(){
        List<DealAndSignIn> dealAndSignInList=dealAndSignInService.getDealAndSignInList();
        PageInfo page=new PageInfo(dealAndSignInList);
        return page ;
    }

    //检测派工异常数据
    @RequestMapping("/arrangeInfo")
    @ResponseBody
    public PageInfo arrangeInfoError(){
        List<ArrangeError> arrangeErrorList=arrangeErrorService.getArrangeErrorList();
        PageInfo page=new PageInfo(arrangeErrorList);
        return page ;
    }

    //检测老人去世异常数据
    @RequestMapping("/elderDead")
    @ResponseBody
    public PageInfo elderDeadError(){
        List<DeadError> deadErrorList=deadErrorService.getDeadErrorList();
        PageInfo page=new PageInfo(deadErrorList);
        return page ;
    }

    //检测老人住院异常数据
    @RequestMapping("/ElderHosp")
    @ResponseBody
    public PageInfo ElderHospError(){
        List<HospError> hospErrorList=hospErrorService.getHospErrorList();
        PageInfo page=new PageInfo(hospErrorList);
        return page ;
    }

}
